<!--
 * @Author: Bonnie
 * @Date: 2021-08-30 18:10:46
 * @LastEditTime: 2021-12-21 10:25:15
 * @LastEditors: Bonnie
 * @Description: 
 * @FilePath: /public_demo/src/components/Header.vue
 * 可以输入预定的版权声明、个性签名、空行等
-->

<template>
  <div class="header-container pl40 pr40 border-box flex flex-between">
    <div class="left">
      <h2 class='cursor-pointer' @click="toHome">有趣的开源小功能</h2>
    </div>
    <div class="right flex flex-center">
      <img
        class="avatar"
        src="http://touxiangkong.com/uploads/allimg/20203301301/2020/3/Vzuiy2.jpg"
      />
    </div>
  </div>
</template>
<script>
export default {
  name: "Header",
  methods: {
    toHome() {
      this.$router.push("/");
    }
  }
};
</script>
<style lang='scss' scoped>
.header-container {
  width: 100%;
  height: 70px;
  background-color: #eee;
  box-sizing: border-box;
  padding: 0 20px;
  .right {
    .avatar {
      margin-right: 8px;
      width: 38px;
      height: 38px;
      border-radius: 50%;
    }
  }
}
</style>
 